Helpful Information
 
 
Category: BCB 6.0
BCB 6.0 -> E2303 Type name expected

I keep having problems with the error "E2303 Type name expected" in Borland C++ Builder projects. I have researched it on Google but have not been able to find a solution. It has popped up twice in the last day in two seperate third-party sets of code. Either both these companies have something wrong with their code or there's something wrong with my setup. I get this error on both my laptop and workstation.

The first place I got this error was trying to compile a piece of sample code that was in C++ Builder Developer's Journal. Their code was version 5.0 and I'm using 6.0 Enterprise SP4.

Here's the source code I tried to compile (~300 line project):
http://home.alltel.net/olivia.caillouet/TreeListView.zip

Here's a screenshot of the error:
http://home.alltel.net/olivia.caillouet/TreeListViewError.jpg

The second item that caused this error was a set of controls from ESB Consulting. These VCL controls have dropdown calculators to use with currency data. I created a form, put one calculator dropdown on it, compiled and got the error. I wrote no code: just a control on a form.

Here's the controls I downloaded:
http://www.esbconsult.com.au/esbpcs2/features-calcs.html

Here's a screenshot of the error:
http://home.alltel.net/olivia.caillouet/ESB_Error.jpg

These are just two examples of the problems I've been having. Has anyone else encountered this before? Since I can't get a clue as to the source of this error, I don't know if the problem is on their end or mine. If anyone out there has BCPPB 6.0 and can just tell me if this project compiles on their machine that would be a big help in identifying the problem as being with my machine.

Thanks,
Darryl

hmm compiled fine for me. All I can guess is that your settings our out of whack somewhere. If it isn't too inconvienient, I would just reinstall BCB.

It's weird that it won't compile on two separate machines with exactly the same error. But at least I now know where to concentrate my efforts.

Thanks for taking the time to compile it.

Originally posted by AGibel
hmm compiled fine for me. All I can guess is that your settings our out of whack somewhere. If it isn't too inconvienient, I would just reinstall BCB. I found a machine that I was able to load a clean install from the original disks on. I still got the same error. The original program was written with version 5. I'm running version 6.0 Enterprise. Unfortunately I keep getting this error with controls and demos I really want to compile so I can use in a real program. Bummer...

Problem solved. The TreeListView.h file needed the following line added at the top:

#include <comctrls.hpp>

Since it worked for AGibel but would not work for me, I'm guessing that his precompiled headers already had this file in them and mine did not. I'm not enough of an expert to know if this is true or not, but it was the only reason I can think it worked for him but not for me.

Hmm thats strange, I dont have that include on mine. When I load the program, It tells me it is converting it into 6. (I have the personal ed. btw, so that may be the deciding factor.)

The vcl.h file is included in all of the projects and controls what goes into the precompiled headers. By adding the following line to vcl.h

#define INC_VCLEXT_HEADERS

I was able to yank the line

#include <comctrls.hpp>

from my code and get it to compile. So you were right in your initial post when you said "your settings are out of whack somewhere". My precompiled headers were missing a common file that a lot of other developers automatically include.










privacy (GDPR)